home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tttdem51.zip / MENUDEM3.PAS < prev    next >
Pascal/Delphi Source File  |  1989-01-31  |  4KB  |  134 lines

  1. Program MenuTTT5_Demo_2;
  2.  
  3. Uses CRT, FastTTT5, DOS, WinTTT5, KeyTTT5, MenuTTT5;
  4.  
  5. var
  6.   M : menu_record;
  7.   Choice, Retcode : integer;
  8.   Ch : char;
  9.  
  10.  
  11.   Procedure Display_Help_Text(L1,L2,L3:string);
  12.   {}
  13.   const
  14.       X1 = 1;
  15.       Y1 = 15;
  16.       X2 = 40;
  17.       Y2 = 21;
  18.       F1  = white;
  19.       F2  = yellow;
  20.       B  = blue;
  21.   begin
  22.       MkWin(X1,Y1,X2,Y2,F1,B,1);
  23.       WriteBetween(X1,X2,Y1,yellow,B,' H E L P ');
  24.       WriteBetween(X1,X2,Y1+2,F2,B,L1);
  25.       WriteAt(X1+2,Y1+3,F1,B,L2);
  26.       WriteAt(X1+2,Y1+4,F1,B,L3);
  27.       WriteBetween(X1,X2,Y2,F1,B,' press any key ... ');
  28.       DelayKey(20000);   {wait 20 seconds or user presses key}
  29.       Rmwin;
  30.   end; {of proc Display_Help_Text}
  31.  
  32.  
  33.  
  34. {$F+}
  35.   Procedure Topic_Sensitive_Help(var Ch:char; Choice:integer; var Ecode:integer);
  36.   {this procedure is Hooked into the menu}
  37.   begin
  38.       If Ch = #187 then   {F1}
  39.       begin
  40.           case Choice of
  41.           1 :Display_Help_Text(
  42.              'Authorization',
  43.              'Select this option before loading',
  44.              'any databases - must enter password.'   
  45.              );
  46.           2 :Display_Help_Text(
  47.              'Load DataBase',
  48.              'Select this option to retrieve a',
  49.              'missile database from disk.'   
  50.              );
  51.           3 :Display_Help_Text(
  52.              'Re-Index Database',
  53.              'Select this option to reorganize',
  54.              'the database and improve performance.'   
  55.              );
  56.           4 :Display_Help_Text(
  57.              'New Data',
  58.              'Select this option to add new miss-',
  59.              'ile site, or change existing one.'   
  60.              );
  61.           5 :Display_Help_Text(
  62.              'Save Database',
  63.              'Select this option to store new',
  64.              'data back to the disk drive.'   
  65.              );
  66.           6 :Display_Help_Text(
  67.              'Print Reports',
  68.              'Select this option to print the',
  69.              'missile summary for Europe/USA.'   
  70.              );
  71.           7 :Display_Help_Text(
  72.              'QUIT',
  73.              'If you don''t know what quit',
  74.              'means why are you in the army?'   
  75.              );
  76.           end;  {Case}
  77.       end;
  78.   end; {of proc Topic_Sensitive_Help}
  79. {$F-}
  80.  
  81. Procedure Define_M;
  82. begin
  83.     Menu_Set(M);
  84.     With M do
  85.     begin
  86.         Heading1 := 'Missile Sites';
  87.         Heading2 := 'Main Menu';
  88.         Topic[1]  := '  Authorization';
  89.         Topic[2]  := '  Load Database';
  90.         Topic[3]  := '  Re-index Database ';
  91.         Topic[4]  := '  Input new Data';
  92.         Topic[5]  := '  Save Database';
  93.         Topic[6]  := '  Print Reports';
  94.         Topic[7]  := '  Quit';
  95.         TotalPicks := 7;
  96.         PicksPerLine := 1;
  97.         AddPrefix := 4;
  98.         TopleftXY[1] := 0;        {auto center}
  99.         TopLeftXY[2] := 4;
  100.         BoxType := 5;
  101.         Margins := 5;
  102.         Colors[1] := white;
  103.         Colors[2] := blue;
  104.         Colors[3] := lightgray;
  105.         Colors[4] := red;
  106.         Colors[5] := cyan;
  107.         AllowEsc := true;
  108.         Hook := Topic_Sensitive_Help;
  109.     end;
  110. end;
  111.  
  112. begin
  113.     Fillscreen(1,1,80,22,white,blue,chr(177));
  114.     ClearText(1,23,80,25,white,blue);
  115.     WriteCenter(24,yellow,blue,'TechnoJock''s Turbo Toolkit');
  116.     WriteCenter(2,yellow,blue,'Press F1 for menu help');
  117.     Choice := 1;
  118.     Define_M;
  119.     DisplayMenu(M,true,Choice,Retcode);
  120.     writeln;
  121.     GotoXY(1,20);
  122.     If Retcode = 0 then
  123.        Writeln('You chose option ',Choice)
  124.     else
  125.        Writeln('You escaped!');
  126.     DelayKey(3000);
  127.     Reset_StartUp_Mode;
  128.     Clrscr;
  129.     WriteAT(1,1,white,black,'Run DemoTTT.exe for the main demo program');
  130.     WriteAT(1,2,white,black,'TechnoJock''s Turbo Toolkit v5.0');
  131.     GotoXY(1,5);
  132. end.
  133.  
  134.